import 'reflect-metadata';
import { DataSource } from 'typeorm';
require('dotenv').config({ path: `.env.${process.env.NODE_ENV}` });
// 获取.env文件中的环境变量
const { MYSQL_HOST, MYSQL_USERNAME, MYSQL_PASSWORD } = process.env;
export const AppDataSource = new DataSource({
  type: 'mysql',
  host: MYSQL_HOST,
  port: 3309,
  username: MYSQL_USERNAME,
  password: MYSQL_PASSWORD,
  database: 'chf',
  synchronize: true,
  logging: false,
  entities: ['src/entity/**/*.ts'],
  migrations: ['src/migration/**/*.ts'],
  subscribers: ['src/subscriber/**/*.ts'],
});